Skip to content

Commit

Permalink
feat: Add gatsby-theme-minimal-blog (#151)
Browse files Browse the repository at this point in the history
* initial plop setup

* initial theme and theme-core setup

* more initial styles

* add a lot of stuff

* add code block component, make different basePath work

* various fixes

* add e2e tests

* optimize mobile styles

* add skipNav

* add manifest icons

* change font to ibm plex sans

* optimizations

* add READMEs

* small fix

* fix typo

* add minimal-blog to www

* add RSS feed
  • Loading branch information
LekoArts committed Nov 16, 2019
1 parent 307df50 commit 344a52c
Show file tree
Hide file tree
Showing 90 changed files with 4,397 additions and 535 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ jobs:
- e2e-test:
example-name: graphql-playground

e2e-test-minimal-blog:
<<: *e2e-executor
steps:
- e2e-test:
example-name: minimal-blog

workflows:
version: 2
lint-test:
Expand All @@ -148,3 +154,5 @@ workflows:
<<: *e2e-test-workflow
- e2e-test-graphql-playground:
<<: *e2e-test-workflow
- e2e-test-minimal-blog:
<<: *e2e-test-workflow
115 changes: 115 additions & 0 deletions cypress/e2e/minimal-blog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/// <reference types="../support/index" />
/// <reference types="cypress" />
/// <reference types="@types/testing-library__cypress" />

describe(`gatsby-theme-minimal-blog`, () => {
beforeEach(() => {
cy.visit(`/`).waitForRouteChange()
})
it(`should render the title`, () => {
cy.get(`h1`).within(() => {
cy.findByText(/Lupin/i)
})
})
it(`should link the about page`, () => {
cy.get(`nav`).within(() => {
cy.findByText(/About/i)
.click()
.waitForRouteChange()
.assertRoute(`/about`)
})
})
it(`should link the blog page`, () => {
cy.get(`nav`).within(() => {
cy.findByText(/Blog/i).click()
})
cy.waitForRouteChange()
.assertRoute(`/blog`)
.get(`h2`)
.within(() => {
cy.findByText(/Blog/i)
})
.findByText(/Fantastic Beasts and Where to Find Them/i)
.findByText(/View all tags/i)
})
it(`should have functioning tags in list items`, () => {
cy.visit(`/blog`)
.waitForRouteChange()
.findByText(/Tutorial/i)
.click()
.waitForRouteChange()
.assertRoute(`/tags/tutorial`)
.get(`h2`)
.within(() => {
cy.findByText(/Tutorial/i)
})
.findByText(/Introduction to "Defence against the Dark Arts"/i)
})
it(`should have functioning tags overview page`, () => {
cy.visit(`/blog`)
.waitForRouteChange()
.findByText(/View all tags/i)
.click()
.waitForRouteChange()
.assertRoute(`/tags`)
.get(`h2`)
.within(() => {
cy.findByText(/Tags/i)
})
.findByText(/Novel/i)
})
it(`should have social media links`, () => {
cy.get(`header`).within(() => {
cy.findByText(/Twitter/i).should(`have.attr`, `href`, `https://twitter.com/lekoarts_de`)
})
})
it(`should render the hero`, () => {
cy.findByText(/Those nasty Dementors/i)
})
it(`should render the latest posts`, () => {
cy.findByText(/Latest Posts/i)
.findByText(/Fantastic Beasts and Where to Find Them/i)
.findByText(/Read all posts/i)
})
it(`should render the bottom part`, () => {
cy.findByText(/Projects/i)
.findByText(/Instagram Project "Proprius"/i)
.should(`have.attr`, `href`, `https://www.lekoarts.de/en/projects/private-instagram-project-proprius`)
})
it(`should render the footer`, () => {
cy.findByLabelText(`Link to the theme's GitHub repository`)
.contains(`Theme`)
.findByLabelText(`Link to the theme author's website`)
.contains(`LekoArts`)
.findByText(/© 2019 by Lupin./i)
})
it(`should link to individual blog post`, () => {
cy.findByText(/Introduction to "Defence against the Dark Arts"/i)
.click()
.waitForRouteChange()
.assertRoute(`/introduction-to-defence-against-the-dark-arts`)
.get(`h2`)
.within(() => {
cy.findByText(/Introduction to "Defence against the Dark Arts"/i)
})
.findByText(/07.11.2019/i)
.findByText(/Tutorial/i)
.findByText(/2 min read/i)
.findByText(
/Thestral dirigible plums, Viktor Krum hexed memory charm Animagus Invisibility Cloak three-headed Dog./i
)
})
it(`should render the light/dark mode toggle`, () => {
cy.findByLabelText(/Activate Dark Mode/i)
})
it(`should have functioning dark mode toggle`, () => {
cy.findByTestId(`theme-root`)
.should(`have.css`, `color`, `rgb(45, 55, 72)`)
.should(`have.css`, `background`, `rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box`)
.findByLabelText(/Activate Dark Mode/i)
.click()
.findByTestId(`theme-root`)
.should(`have.css`, `color`, `rgb(203, 213, 224)`)
.should(`have.css`, `background`, `rgb(26, 32, 44) none repeat scroll 0% 0% / auto padding-box border-box`)
})
})
8 changes: 8 additions & 0 deletions examples/minimal-blog/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are supported funding model platforms

github: [LekoArts]
patreon: lekoarts
open_collective: # Replace with a single Open Collective username
ko_fi: lekoarts
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL
69 changes: 69 additions & 0 deletions examples/minimal-blog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
**/node_modules/**

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.*
!.env.example

.cache
**/.cache
public

.idea
.vscode
.DS_Store
21 changes: 21 additions & 0 deletions examples/minimal-blog/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 LekoArts

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 344a52c

Please sign in to comment.