Skip to content

Commit

Permalink
Prepping for release
Browse files Browse the repository at this point in the history
* Build pipeline
* Getting started (shameless rip from statiq-starter-kontent-lumen)
* content.zip contains an export of the Kontent project
  • Loading branch information
alanta committed Nov 24, 2020
1 parent 274c766 commit 0786bd9
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 8 deletions.
50 changes: 50 additions & 0 deletions .github/dotnet-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: .NET Core

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Publish
run: dotnet publish --configuration Release --no-build -o ./tools
- name: "Artifact : generator"
uses: actions/upload-artifact@v2
with:
name: "Generator"
path: ./tools
- name: Publish
run: dotnet run --configuration Release
env:
LinkRoot: ${{ secrets.LINKROOT }} # Fix subfolder links https://statiq.dev/framework/configuration/settings
Host: ${{ secrets.HOST }} # Make links absolute (for feeds, OG...)
- name: "Artifact : site"
uses: actions/upload-artifact@v2
with:
name: "Site"
path: ./output
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: output
CLEAN: true # Automatically remove deleted files from the deploy branch
63 changes: 59 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Memoirs Statiq Kontent Theme
# Memoirs Statiq Kontent Theme

This is a full featured theme for [Kontent](https://kontent.ai/) and [Statiq](https://statiq.dev/) using [Kontent.Statiq](https://github.com/alanta/Kontent.Statiq).

Expand All @@ -20,12 +20,67 @@ This is a full featured theme for [Kontent](https://kontent.ai/) and [Statiq](ht
* Atom and RSS feeds
* HTML minification with [NUglify](https://github.com/trullock/NUglify)

## Credits
## Getting Started

This theme was adopted from the Memoirs Jekyl theme by [Wowthemes](https://bootstrapstarter.com/bootstrap-templates/jekyll-theme-memoirs/). Please [buy them coffee](https://www.wowthemes.net/donate/)!
### Requirements

![memoirs](https://bootstrapstarter.com/assets/img/themes/memoirs-jekyll.jpg)
- [.NET Core 3.1](https://dotnet.microsoft.com/download)

### Clone the codebase

1. Click the ["Use this template"](https://github.com/Kontent/statiq-starter-kontent-lumen/generate) button to [create your own repository from this template](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template).

### Running locally

- `dotnet run -- preview`
- You can also emulate running the project in a virtual directory by appending `--virtual-dir memoirs`. See all preview [options](https://statiq.dev/web/running/preview-server).
- Go to `http://localhost:5080/`

🎊🎉 **You are now ready to explore the code base!**

> By default, the content is loaded from a shared Kentico Kontent project. If you want to use your own clone of the project so that you can customize it and experiment with Kontent, continue to the next section.
### Create a content source

1. Go to [app.kontent.ai](https://app.kontent.ai) and [create an empty project](https://docs.kontent.ai/tutorials/set-up-kontent/projects/manage-projects#a-creating-projects)
1. Go to the "Project Settings", select API keys and copy the following keys for further reference
- Project ID
- Management API key
1. Use the [Template Manager UI](https://kentico.github.io/kontent-template-manager/import) for importing the content from [`content.zip`](./content.zip) file and API keys from previous step. Check *Publish language variants after import* option before import.

> Alternatively, you can use the [Kontent Backup Manager](https://github.com/Kentico/kontent-backup-manager-js) and import data to the newly created project from [`content.zip`](./content.zip) file via command line:
>
> ```sh
> npm i -g @kentico/kontent-backup-manager
>
> kbm --action=restore --projectId=<Project ID> --apiKey=<Management API key> --zipFilename=content
> ```
>
> Go to your Kontent project and [publish all the imported items](https://docs.kontent.ai/tutorials/write-and-collaborate/publish-your-work/publish-content-items).
1. Map the codebase to the data source
- adjust the `DeliveryOptions:ProjectId` key in `appSettings.json`
🚀 **You are now ready to use the site with your own Kentico Kontent project as data source!**
### Production deployment to GitHub pages
- Enable GitHub actions in your repo
- Copy the [`.github/workflows/dotnet-core.yml`](https://github.com/alanta/memoirs-theme/blob/master/.github/workflows/dotnet-core.yml) to your project
- Go to the repository secrets and set:
- [`LinkRoot`](https://statiq.dev/framework/configuration/settings) to the relative path of your project (e.g. `/statiq-starter-kontent-lumen`) - this is to ensure that all links work properly when deployed to a subfolder
- [`Host`](https://statiq.dev/framework/configuration/settings) to the domain of your project (e.g. `domain.tld`) - this is to ensure that absolute links are generated where required
## Customizing
* Open `appsettings.json` to tweak the site name etc.
* Enable Google Tag Manager by setting the `GoogleAnalytics` setting
* Update the `DisqusId` to hook up to your Disqus account
* Make sure you update / adjust Prism syntax highlighter to your liking. Follow the link at the top of [prism.js](input/assets/js/prism.js) and adjust the settings as needed.
## Credits
This theme was adopted from the Memoirs Jekyl theme by [Wowthemes](https://bootstrapstarter.com/bootstrap-templates/jekyll-theme-memoirs/). Please [buy them coffee](https://www.wowthemes.net/donate/)!
![memoirs](https://bootstrapstarter.com/assets/img/themes/memoirs-jekyll.jpg)
7 changes: 3 additions & 4 deletions appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"ProjectId": "e10d7fbd-315f-01e2-20a5-e067cdf43f2f"
},
"LinkHideExtensions": false,
"Host": "",
"LinksUseHttps": true,
"LinkRoot": "",
"LinkLowercase": true,
"Site": {
"name": "Memoirs",
Expand All @@ -16,9 +14,10 @@
"Copyright": "Memoirs",
"Lazyimages": false,
"Authorbox": true,
"DisqusId": "demowebsite",
"DisqusId": "demowebsite",
"ContactFormUrl": "https://formspree.io/f/maylbkgo",
"GoogleAnalytics": "", // UA-xxxxxxxx-1
"MailChimpList": "https://wowthemes.us11.list-manage.com/subscribe/post?u=8aeb20a530e124561927d3bd8&amp;id=8c3d2d214b"
"MailChimpList": "https://wowthemes.us11.list-manage.com/subscribe/post?u=8aeb20a530e124561927d3bd8&amp;id=8c3d2d214b",
"OptimizeOutput": false
}
}
Binary file added content.zip
Binary file not shown.

0 comments on commit 0786bd9

Please sign in to comment.