Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added a blank nue example project for use with 'create' cli #466

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/push-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
matrix:
dir: # dirs in "examples" to run build & push process for
- simple-blog
- blank

env:
dir: 'packages/examples/${{ matrix.dir }}/'
Expand Down
4 changes: 4 additions & 0 deletions packages/examples/blank/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.dist/

*.gz
.env
18 changes: 18 additions & 0 deletions packages/examples/blank/@global/colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

:root {

/* slate gray */
--gray-100: #f3f4f6;
--gray-200: #e5e7eb;
--gray-300: #d1d5db;
--gray-500: #6b7280;
--gray-800: #1f2937;
--gray-900: #111827;

/* main color */
--main-500: #3b82f6;
--main-600: #2563eb;

/* special colors */
--marker: #ffff7a;
}
36 changes: 36 additions & 0 deletions packages/examples/blank/@global/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* CSS reset */
*, *::before, *::after {
box-sizing: border-box;
}

/* consistent whitespace */
ul, ol ,figure, pre {
margin: 2em 0;
}

/* page layout */
body {
max-width: 1000px;
margin: 0 auto;
padding: max(4rem, 7.5%) 5% 5% 5%;

/* global footer */
> footer {
border-top: 1px solid var(--gray-200);
margin-top: 8rem;
padding-top: 1rem;
text-align: center;

nav {
a {
color: var(--gray-500);
opacity: .8;
text-decoration: none;

&:hover {
opacity: 1;
}
}
}
}
}
3 changes: 3 additions & 0 deletions packages/examples/blank/@global/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer>
<navi :items="navigation.footer"/>
</footer>
23 changes: 23 additions & 0 deletions packages/examples/blank/@global/typography.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
body {
font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Segoe UI, Roboto;
}

/* heading and subtitle */
h1 {
letter-spacing: -0.03em;
font-size: clamp(2rem, 5vw, 2.4rem);

&, + p {
line-height: 1.3;
margin: 0 auto .2em;
max-width: 40rem;
text-align: center;
text-wrap: balance;
}

+ p {
font-size: clamp(1em, 5vw, 1.25em);
font-weight: 300;
margin-bottom: 2em;
}
}
15 changes: 15 additions & 0 deletions packages/examples/blank/@library/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
img {
display: block;
height: auto;
margin: 0 auto 1vw;
width: max(20vw, 10rem);
}

a {
color: var(--main-500);
text-decoration: none;

&:hover {
color: var(--main-600);
}
}
9 changes: 9 additions & 0 deletions packages/examples/blank/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Nue blank website template

A (mostly) blank template for the `nue create` command:

## Links

- [Template tutorial](https://nuejs.org/docs/tutorial.html)

- [Installing Nue](https://nuejs.org/docs/installation.html)
Binary file added packages/examples/blank/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/examples/blank/img/logomark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/examples/blank/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Welcome
include: ['home']
---

![Nue Logo](/img/logomark.png)

# Welcome to [Nue](https://nuejs.org/)

This is a blank Nue project that you can use as a starting point for your own website.
20 changes: 20 additions & 0 deletions packages/examples/blank/site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# yaml-language-server: $schema=https://json.schemastore.org/nuejs-site.json

globals: ['@global']
libs: ['@library']

native_css_nesting: true
inline_css: true
sections: true

title_template: 'Nue / %s'
author: Nue
favicon: /img/favicon.png
description: A (mostly) blank Nue project
port: 8083

navigation:
footer:
- © Nue: https://nuejs.org/
target: _blank
rel: noopener noreferrer
4 changes: 3 additions & 1 deletion packages/examples/simple-blog/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.dist/

*.gz
.env
.env
2 changes: 1 addition & 1 deletion packages/nuekit/src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createKit } from './nuekit.js'

const templates = {
'simple-blog': 'welcome/',
'blank': '',
}


Expand Down Expand Up @@ -46,7 +47,6 @@ export async function create(args = {}) {

// must be empty directory
if (files.length) return console.error('Please create the template to an empty directory')

} else await fs.mkdir(root, { recursive: true })

// download archive
Expand Down
Loading