Skip to content

Commit

Permalink
feat: Embed example Hugo site
Browse files Browse the repository at this point in the history
  • Loading branch information
slashtechno authored Jun 26, 2024
1 parent 96d8642 commit 16806f8
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config.toml
config/
!config/.gitkeep
*_markdown/
# *_markdown/
.env
credentials.*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "output_markdown/themes/PaperMod"]
path = output_markdown/themes/PaperMod
url = https://github.com/adityatelange/hugo-PaperMod.git
5 changes: 5 additions & 0 deletions input_markdown/hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
thisisatitle: Hello again!
canonicalURL: http://itsfrommars.blogspot.com/2024/06/hello-world_11.html
---
Hello, again!
23 changes: 23 additions & 0 deletions output_markdown/.gitea/workflows/vercel-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
# branches-ignore:
# - main
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Get Git submodules
run: git submodule update --init --recursive
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
21 changes: 21 additions & 0 deletions output_markdown/.gitea/workflows/vercel-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
4 changes: 4 additions & 0 deletions output_markdown/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public/
.hugo_build.lock
.vercel
..git/
5 changes: 5 additions & 0 deletions output_markdown/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++
6 changes: 6 additions & 0 deletions output_markdown/content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Blog
description: "Thoughts, stories and ideas."
---
<!-- This is a section[0] that uses themes/PaperMod/layouts/_default/list.html-->
<!-- [0]: https://gohugo.io/content-management/sections/ -->
22 changes: 22 additions & 0 deletions output_markdown/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
baseURL: 'https://test-cross-blogger.vercel.app'
languageCode: en-us
# This title is used as the website title (navbar and meta title)
title: Cross Blogger Showcase
theme: PaperMod

params:
description: 'Example Hugo site using Cross Blogger to use Blogger as a headless CMS'
env: production # Enables enhanced SEO
CanonicalLinkText: "Canonical URLs can optionally be enabled. This post was fetched from"
ShowCanonicalLinks: true
profileMode:
subtitle: 'The blog posts below are fetched from Blogger using Cross Blogger'
enabled: true
buttons:
- name: Blog
url: "/blog/"
- name: GitHub
url: "https://github.com/slashtechno/cross-blogger"
socialIcons: # Show the respective social icon linked to the corresponding URL
- name: github
url: "https://github.com/slashtechno/cross-blogger"
12 changes: 12 additions & 0 deletions output_markdown/layouts/partials/post_canonical.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ if and .Params.canonicalURL (or .Params.ShowCanonicalLink site.Params.ShowCanonicalLinks) -}}
<!-- https://gohugo.io/functions/urls/parse/ -->
{{ $url := urls.Parse .Params.canonicalURL }}
<!-- https://gohugo.io/functions/strings/replacere/ -->
{{ $urlWithoutScheme := replaceRE "^https?://" "" $url.String }}

{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }}&nbsp;|&nbsp;{{- end -}}
<span>
{{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}}
&nbsp;<a href="{{ trim .Params.canonicalURL " " }}" title="{{ trim .Params.canonicalURL " " }}" target="_blank" rel="noopener noreferrer">{{ $urlWithoutScheme}}</a>
</span>
{{- end }}
1 change: 1 addition & 0 deletions output_markdown/themes/PaperMod
Submodule PaperMod added at 9ea3bb
7 changes: 7 additions & 0 deletions output_markdown/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"build": {
"env": {
"HUGO_VERSION": "0.125.3"
}
}
}

0 comments on commit 16806f8

Please sign in to comment.