Skip to content

Commit

Permalink
feat: root json-ld (#103)
Browse files Browse the repository at this point in the history
* feat: root json-ld

* feat: add json-ld

* feat: add analytics badge

* feat: change robots.txt
  • Loading branch information
mihirogi committed Feb 16, 2021
1 parent 2a4eda3 commit 9245208
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
![released](https://github.com/MSakamaki/scully-homepage/workflows/Deploy%20to%20Firebase%20Hosting%20on%20merge/badge.svg)

[![](https://img.shields.io/badge/AccessTo-BLOG-blue)](https://wot.mihirogi.org/)

[![](https://img.shields.io/badge/AccessTo-LightHouseServer-blue)](https://still-island-43535.herokuapp.com/app/projects/scully-homepage/dashboard)

[![](https://img.shields.io/badge/AccessTo-SearchConsole-blue)](https://search.google.com/search-console?resource_id=sc-domain%3Awot.mihirogi.org&hl=ja)

[![](https://img.shields.io/badge/AccessTo-GoogleAnalytics-blue)](https://analytics.google.com/analytics/web/?authuser=0#/p251694995/reports/defaulthome?params=_u..nav%3Ddefault)

[![](https://img.shields.io/badge/AccessTo-Firebase-FFCA28)](https://console.firebase.google.com/u/0/project/scully-homepage-5df8c/overview)

[![](https://img.shields.io/badge/AccessTo-GitHub-4078c0)](https://github.com/MSakamaki/scully-homepage)

## development

```sh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div [innerHTML]="jsonld"></div>
<section>
<h2>記事のタグ一覧</h2>
<div class="filter">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { UserEventHookTransferStateService } from './user-event-hook-transfer-st
import { Apollo, gql } from 'apollo-angular';
import { Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { DomSanitizer } from '@angular/platform-browser';

/** scully.TransferStateService name: article summary */
const STATE_NAME_ARTICLE = 'articles';
Expand Down Expand Up @@ -49,9 +50,25 @@ export class HomeComponent implements OnInit {
});
}

public jsonld = this.sanitizer
.bypassSecurityTrustHtml(`<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "WebSite",
"name": "wot",
"url": "https://wot.mihirogi.org/",
"potentialAction": {
"@type": "SearchAction",
"target": "{search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>`);

constructor(
private apollo: Apollo,
private transferState: UserEventHookTransferStateService
private transferState: UserEventHookTransferStateService,
private sanitizer: DomSanitizer
) {}

private readonly articleQueryRef$ = this.apollo.watchQuery<{
Expand Down
3 changes: 1 addition & 2 deletions apps/homepage/src/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
User-agent: *
Disallow: /
Sitemap:https://scully-homepage-5df8c.web.app/sitemap.xml
Sitemap:https://wot.mihirogi.org/sitemap.xml

0 comments on commit 9245208

Please sign in to comment.