Skip to content

Commit

Permalink
Add support for RSS
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Nov 4, 2020
1 parent 0799eee commit e24a970
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/js/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{{- template "_internal/schema.html" . -}}
{{ template "_internal/opengraph.html" . }}
{{- template "_internal/twitter_cards.html" . -}}
{{- partial "head/feed" . -}}
{{- partial "head/google-analytics" . -}}
{{- partial "head/site-verification" . -}}
{{- partial "head/baidu-analytics" . -}}
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/head/feed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- with .OutputFormats.Get "rss" -}}
{{- printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML -}}
{{- end -}}
5 changes: 5 additions & 0 deletions layouts/partials/header/feed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<li class="nav-item ml-1 mr-2">
{{ with .OutputFormats.Get "rss" -}}
<a class="nav-link" href="{{ .Permalink }}"><i class="fas fa-fw fa-rss"></i></a>
{{ end -}}
</li>
2 changes: 1 addition & 1 deletion layouts/partials/header/language-switcher.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<li class="nav-item ml-1 mr-2">
<li class="nav-item mr-2">
<a class="nav-link" tabindex="0" data-trigger="focus" data-container="#languageSwitcher" data-toggle="popover"
data-placement="bottom" data-target="#languagesPopoverBody" data-html="true">
<i class="fas fa-fw fa-language" ></i>
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/header/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
{{- partial "header/search-form" . -}}
</ul>
<ul class="navbar-nav ml-auto d-flex flex-row">
{{- partial "header/feed" . -}}
{{- partial "header/language-switcher" . -}}
{{- partial "header/palette-switcher" . -}}
{{- partial "header/color-scheme-switcher" . -}}
Expand Down
4 changes: 2 additions & 2 deletions src/js/fontawesome.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { library, dom } from '@fortawesome/fontawesome-svg-core'
import {
faCalendarAlt, faChevronCircleUp, faEnvelope, faFolder, faLanguage, faMoon, faPalette, faSearch, faSun, faTag,
faBuilding, faMapMarkerAlt, faBars,
faBuilding, faMapMarkerAlt, faBars, faRss,
} from '@fortawesome/free-solid-svg-icons'
import {
faFacebook, faGithub, faGitlab, faInstagram, faLinkedin, faQuora, faStackOverflow, faTwitter, faWeibo, faZhihu,
Expand All @@ -10,7 +10,7 @@ import {

library.add(
faCalendarAlt, faChevronCircleUp, faEnvelope, faFolder, faLanguage, faMoon, faPalette, faSearch, faSun, faTag,
faBuilding, faMapMarkerAlt, faBars,
faBuilding, faMapMarkerAlt, faBars, faRss,
)
library.add(
faFacebook, faGithub, faGitlab, faInstagram, faLinkedin, faQuora, faStackOverflow, faTwitter, faWeibo, faZhihu,
Expand Down

0 comments on commit e24a970

Please sign in to comment.