Jacky Zhao
2022-05-03 81fe2d24936ad4b783f41b260b4a4801bacb654b
Merge branch 'hugo' of https://github.com/jackyzha0/quartz into hugo
3 files modified
7 ■■■■ changed files
.github/workflows/deploy.yaml 2 ●●●●● patch | view | raw | blame | history
config.toml 3 ●●●●● patch | view | raw | blame | history
layouts/_default/_markup/render-link.html 2 ●●● patch | view | raw | blame | history
.github/workflows/deploy.yaml
@@ -10,6 +10,8 @@
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod
      - name: Build Link Index
        uses: jackyzha0/hugo-obsidian@v2.12
config.toml
@@ -28,3 +28,6 @@
        lineNumbersInTable = true
        style = "dracula"
        tabWidth = 4
    [frontmatter]
        lastmod = ["lastmod", ":git", "date", "publishDate"]
        publishDate = ["publishDate", "date"]
layouts/_default/_markup/render-link.html
@@ -7,7 +7,7 @@
{{$spacedurl := replace $trimmed "%20" " " }}
{{$fixedUrl := (cond (hasPrefix $spacedurl "/") $spacedurl (print "/" $spacedurl)) | urlize}}
{{$nonexistent := eq (.Page.GetPage $spacedurl).RelPermalink ""}}
{{$rooted := default $spacedurl (strings.TrimRight "/" (.Page.GetPage $spacedurl).RelPermalink) }}
{{$rooted := default $spacedurl ((.Page.GetPage $spacedurl).RelPermalink) }}
<a
  {{if not $nonexistent}}href="{{$rooted}}"{{end}}
  rel="noopener" class="internal-link{{if $nonexistent}} broken{{end}}"