11 Commits

Author SHA1 Message Date
38ff8cdc2c Update README.md 2021-03-10 19:25:16 +01:00
6ff2e56501 fixed image height & js formatting 2020-09-07 17:06:01 +02:00
cupcakearmy
331d47c9e9 update deps, fixed images and version bump 2020-09-03 11:31:22 +02:00
cupcakearmy
8a7393b593 √ersion bump 2020-01-07 23:48:02 +01:00
cupcakearmy
64dad4c4b0 add wp.com to csp 2020-01-07 14:51:25 +01:00
cupcakearmy
e0277ff7e1 add lock file 2020-01-04 17:18:56 +01:00
cupcakearmy
b425bce2a7 only deploy on tag 2020-01-04 17:17:24 +01:00
cupcakearmy
78f9874ace small improvements 2020-01-04 17:04:48 +01:00
941fe46d4d Update README.md 2020-01-04 16:54:52 +01:00
552acbacbe Update README.md 2020-01-04 16:53:48 +01:00
65eac43050 Update README.md 2020-01-04 16:53:19 +01:00
17 changed files with 5333 additions and 93 deletions

View File

@@ -31,5 +31,5 @@ steps:
- docker-compose -f docker-compose.prod.yml down
- docker-compose -f docker-compose.prod.yml up -d
when:
event: push
event: tag
branch: master

5
.gitignore vendored
View File

@@ -6,9 +6,8 @@ data/
# Node
node_modules/
pnpm-lock.yaml
yarn.lock
# Generated
.cache/
liquet/dist/
liquet/dist/
liquet.zip

View File

@@ -2,16 +2,7 @@
A minimalistic and clean wordpress theme. Guteberg support out of the box.
###### Support:
[<img alt="Browserstack" src="http://www.browserstack.com/images/layout/browserstack-logo-600x315.png" width="200">](https://www.browserstack.com)
###### Home
![Home](./docs/Home.png)
###### Post
![Post](./docs/Post.png)
> 🚨 Discontinued
## Required Plugins
@@ -21,6 +12,18 @@ A minimalistic and clean wordpress theme. Guteberg support out of the box.
## Quickstart 🚀
1. Install required plugins (see above)
2. Download the latest zip from [releases](https://github.com/CupCakeArmy/liquet/releases)
2. Download the [latest zip from releases](https://github.com/CupCakeArmy/liquet/releases/latest)
3. Go to: Appearance -> Themes -> Add new and upload the zip.
4. Activate
## Screens
###### Home
![Home](./docs/Home.png)
###### Post
![Post](./docs/Post.png)
###### Support:
[<img alt="Browserstack" src="http://www.browserstack.com/images/layout/browserstack-logo-600x315.png" width="200">](https://www.browserstack.com)

View File

@@ -24,7 +24,7 @@ switch ($type) {
?>
<div id="home">
<div class="flex container vertical middle" id="list-header">
<a class="gohome" href="<?= get_bloginfo('wpurl'); ?>">
<a class="gohome" href="<?= site_url(); ?>">
<span class="alt-font"><?= get_bloginfo('name'); ?></span>
</a>
<div id="header">

View File

@@ -8,7 +8,7 @@ add_theme_support( 'post-thumbnails' );
add_filter( 'wp_headers', function ( $headers ) {
$headers['Content-Security-Policy'] = "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://s.w.org; report-uri csp@nicco.io";
$headers['Content-Security-Policy'] = "default-src 'self' wp.com; script-src 'self' 'unsafe-inline' wp.com; style-src 'self' 'unsafe-inline' wp.com; img-src 'self' wp.com data: https://s.w.org;";
$headers['X-Content-Type-Options'] = 'nosniff';
$headers['X-Frame-Options'] = "deny";
$headers['Strict-Transport-Security'] = "max-age=31536000";

View File

@@ -1,4 +1,4 @@
<?php $dir = get_bloginfo( 'template_directory' ) ?>
<?php $dir = get_template_directory_uri() ?>
<!DOCTYPE html>
<html lang="en">

View File

@@ -12,7 +12,7 @@ $tags = get_tags( [ 'orderby' => 'count', 'order' => 'desc' ] );
</a>
<div class="flex container vertical middle" id="list-header">
<div id="header">
<a href="<?= get_bloginfo( 'wpurl' ); ?>">
<a href="<?= site_url(); ?>">
<h1><?= get_bloginfo( 'name' ); ?></h1>
<h3><?= get_bloginfo( 'description' ); ?></h3>
</a>

View File

@@ -6,7 +6,7 @@ function getNextURL( $next ) {
$post = get_adjacent_post( false, '', ! $next, 'post_tag' );
}
return ( $post ? get_permalink( $post->ID ) : get_bloginfo( 'wpurl' ) );
return ( $post ? get_permalink( $post->ID ) : site_url() );
}
function getDates() {

View File

@@ -14,12 +14,12 @@ $dates = getDates();
<div class="flex item shrink" id="top">
<div class="flex container horizontal middle">
<div class="flex item grow text-align-left" id="left">
<a href="<?= get_bloginfo( 'wpurl' ); ?>">
<a href="<?= site_url(); ?>">
<img src="<?= get_template_directory_uri() . '/vendor/icons/left.svg' ?>" alt="arrow back"/>
</a>
</div>
<div class="flex item shrink gohome" id="center">
<a href="<?= get_bloginfo( 'wpurl' ); ?>">
<a href="<?= site_url(); ?>">
<span class="alt-font"><?= get_bloginfo( 'name' ); ?></span>
</a>
</div>
@@ -28,7 +28,8 @@ $dates = getDates();
$saved = get_option( 'website_url' );
if ( $saved ) : ?>
<a href="<?= $saved; ?>" target="_blank">
<img class="reduce" src="<?= get_template_directory_uri() . '/vendor/logos/website.png' ?>" alt="website"/>
<img class="reduce" src="<?= get_template_directory_uri() . '/vendor/logos/website.png' ?>"
alt="website"/>
</a>
<?php endif; ?>
<a href="javascript:void(0);" onclick="window.toggleLights();">

View File

@@ -2,10 +2,10 @@
Theme Name: Liquet
Author: Niccolo Borgioli
Description: Minimalistic clean theme
Version: 0.13
Version: 0.17
License: MIT
Tags: minimal, simple, typography, clean
Author URI: https://nicco.io
License URI: https://opensource.org/licenses/MIT
Theme URI: https://github.com/cupcakearmy/liquet
*/
*/

View File

@@ -2,8 +2,13 @@
"private": true,
"scripts": {
"dev": "parcel watch --no-hmr --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl",
"build": "parcel build --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl"
"build": "rm -rf ./liquet/dist && parcel build --no-source-maps -d liquet/dist ./src/js/index.js ./src/styles/index.styl"
},
"browserslist": [
"last 2 chrome versions",
"last 2 safari versions",
"last 2 firefox versions"
],
"dependencies": {
"@swup/preload-plugin": "1.0.x",
"jquery": "^3.4.1",

View File

@@ -3,9 +3,9 @@ import lazy from './lazy'
import swup from './swup'
document.addEventListener('DOMContentLoaded', () => {
lights()
lights()
lazy()
swup(() => {
lazy()
swup(() => {
lazy()
})
})
})
})

View File

@@ -1,42 +1,39 @@
import $ from 'jquery'
export default () => {
const bottomOffset = 300
const app = document.getElementById('app')
let loading = false
let page = WPParams.lazy.current_page
const bottomOffset = 300
const app = document.getElementById('app')
let loading = false
let page = WPParams.lazy.current_page
function load() {
function load() {
const pixelToBottom = this.scrollHeight - (this.scrollTop + this.clientHeight)
const pixelToBottom = this.scrollHeight - (this.scrollTop + this.clientHeight)
if (!loading && pixelToBottom < bottomOffset) {
loading = true
if (!loading && pixelToBottom < bottomOffset) {
loading = true
$.ajax({
url: WPParams.lazy.ajaxurl,
data: {
name: window.location.pathname
.replace(/(\/\d+){3}\//, '')
.replace(/\/$/, ''),
action: 'lazy_load',
page,
},
type: 'POST',
success: (data) => {
if (data) {
$('#list').find('hr:last-of-type').after(data) // where to insert posts
page++
loading = false
}
}
})
}
$.ajax({
url: WPParams.lazy.ajaxurl,
data: {
name: window.location.pathname.replace(/(\/\d+){3}\//, '').replace(/\/$/, ''),
action: 'lazy_load',
page,
},
type: 'POST',
success: (data) => {
if (data) {
$('#list').find('hr:last-of-type').after(data) // where to insert posts
page++
loading = false
}
},
})
}
}
// Bind to the scroll event
$('#app').scroll(load)
// Bind to the scroll event
$('#app').scroll(load)
// Check initial page if they need loading
load.bind(app)()
}
// Check initial page if they need loading
load.bind(app)()
}

View File

@@ -1,30 +1,30 @@
export default () => {
// Lights
const key = 'nicco.io:blog:lights'
const CSS = 'body, .wp-block-image img, .thumbnail img {filter: invert(1);} '
const style = window.document.createElement('style')
document.head.appendChild(style)
// Lights
const key = 'nicco.io:blog:lights'
const CSS = 'body, .wp-block-image img, .thumbnail img {filter: invert(1);} '
const style = window.document.createElement('style')
document.head.appendChild(style)
const on = () => {
style.sheet.deleteRule(parseInt(window.localStorage.getItem(key)))
window.localStorage.removeItem(key)
}
const on = () => {
style.sheet.deleteRule(parseInt(window.localStorage.getItem(key)))
window.localStorage.removeItem(key)
}
const off = () => {
const i = style.sheet.insertRule(CSS)
window.localStorage.setItem(key, i)
}
const off = () => {
const i = style.sheet.insertRule(CSS)
window.localStorage.setItem(key, i)
}
const isDark = () => window.localStorage.getItem(key) !== null
const isDark = () => window.localStorage.getItem(key) !== null
if (isDark()) off()
if (isDark()) off()
window.toggleLights = () => isDark() ? on() : off()
window.toggleLights = () => (isDark() ? on() : off())
// Focus scrolling
document.addEventListener('DOMContentLoaded', () => {
const toFocus = document.querySelector('[data-focusme]')
toFocus.tabIndex = '1'
toFocus.focus({preventScroll: true})
})
}
// Focus scrolling
document.addEventListener('DOMContentLoaded', () => {
const toFocus = document.querySelector('[data-focusme]')
toFocus.tabIndex = '1'
toFocus.focus({ preventScroll: true })
})
}

View File

@@ -2,11 +2,11 @@ import Swup from 'swup'
import SwupPreloadPlugin from '@swup/preload-plugin'
export default (fn) => {
const swup = new Swup({
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
plugins: [new SwupPreloadPlugin()],
containers: ['#app']
})
const swup = new Swup({
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
plugins: [new SwupPreloadPlugin()],
containers: ['#app'],
})
swup.on('contentReplaced', fn)
swup.on('contentReplaced', fn)
}

View File

@@ -86,6 +86,10 @@
display: inline-block
font-size: 105%
figure
img
height: 100%
.links
& > div
transform rotate(180deg) scale(1)

5231
yarn.lock Normal file

File diff suppressed because it is too large Load Diff