Skip to content

Commit 97708d2

Browse files
authored
Merge pull request #31 from haplo/static-to-root
Move static/templates/translations back to root
2 parents 1935963 + 67a2c14 commit 97708d2

File tree

247 files changed

+57
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+57
-36
lines changed

.github/workflows/check-npm-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
paths:
55
- 'package*.json'
66
- 'gulpfile.js'
7-
- 'pelican/themes/reflex/static/stylesheet/**/*.less'
8-
- 'pelican/themes/reflex/static/dark-theme/**/*.js'
9-
- 'pelican/themes/reflex/static/pygments/**/*.css'
7+
- 'static/stylesheet/**/*.less'
8+
- 'static/dark-theme/**/*.js'
9+
- 'static/pygments/**/*.css'
1010
- '.github/workflows/check-npm-build.yml'
1111
workflow_call:
1212

AGENTS.md

Lines changed: 23 additions & 22 deletions

example/pelicanconf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
ROBOTS = "index, follow"
1616

17-
THEME = "../pelican/themes/reflex"
17+
THEME = ".."
1818
PATH = "content"
1919
OUTPUT_PATH = "blog/"
2020
TIMEZONE = "UTC"

gulpfile.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,46 @@ var gulp = require('gulp'),
77

88
gulp.task('less', function () {
99
return gulp.src([
10-
'./pelican/themes/reflex/static/stylesheet/dark-theme.less',
11-
'./pelican/themes/reflex/static/stylesheet/style.less',
10+
'./static/stylesheet/dark-theme.less',
11+
'./static/stylesheet/style.less',
1212
])
1313
.pipe(less())
1414
.pipe(postcss([cssnano()]))
1515
.pipe(rename({
1616
extname: '.min.css'
1717
}))
18-
.pipe(gulp.dest('./pelican/themes/reflex/static/stylesheet'));
18+
.pipe(gulp.dest('./static/stylesheet'));
1919
});
2020

2121
gulp.task('uglify', function () {
22-
return gulp.src('./pelican/themes/reflex/static/dark-theme/dark-theme.js')
22+
return gulp.src('./static/dark-theme/dark-theme.js')
2323
.pipe(uglify())
2424
.pipe(rename({
2525
extname: '.min.js'
2626
}))
27-
.pipe(gulp.dest('./pelican/themes/reflex/static/dark-theme'));
27+
.pipe(gulp.dest('./static/dark-theme'));
2828
});
2929

3030
gulp.task('cp', function () {
3131
return gulp.src('./node_modules/font-awesome/**/*.{min.css,otf,eot,svg,ttf,woff,woff2}')
32-
.pipe(gulp.dest('./pelican/themes/reflex/static/font-awesome'));
32+
.pipe(gulp.dest('./static/font-awesome'));
3333
});
3434

3535
gulp.task('pygments', function () {
36-
return gulp.src(['./pelican/themes/reflex/static/pygments/*.css', '!./pelican/themes/reflex/static/pygments/*min.css'])
36+
return gulp.src(['./static/pygments/*.css', '!./static/pygments/*min.css'])
3737
.pipe(postcss([cssnano()]))
3838
.pipe(rename({
3939
extname: '.min.css'
4040
}))
41-
.pipe(gulp.dest('./pelican/themes/reflex/static/pygments'));
41+
.pipe(gulp.dest('./static/pygments'));
4242
});
4343

4444
gulp.task('watch-less', function () {
45-
return gulp.watch('pelican/themes/reflex/static/stylesheet/*.less', gulp.task('less'));
45+
return gulp.watch('static/stylesheet/*.less', gulp.task('less'));
4646
});
4747

4848
gulp.task('watch-js', function () {
49-
return gulp.watch('pelican/themes/reflex/static/dark-theme/!(*.min).js', gulp.task('uglify'));
49+
return gulp.watch('static/dark-theme/!(*.min).js', gulp.task('uglify'));
5050
})
5151

5252
gulp.task('default', gulp.series(['less', 'uglify', 'cp', 'pygments']));

pdm_build.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from pathlib import Path
2+
3+
4+
def pdm_build_update_files(context, files):
5+
if context.target != "wheel":
6+
return
7+
8+
for dirname in ["static", "templates", "translations"]:
9+
to_rename = [
10+
(relpath, local_path)
11+
for relpath, local_path in list(files.items())
12+
if relpath.startswith(f"{dirname}/")
13+
]
14+
for relpath, local_path in to_rename:
15+
del files[relpath]
16+
new_relpath = f"pelican/themes/reflex/{relpath}"
17+
files[new_relpath] = local_path

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ build-backend = "pdm.backend"
3333
[tool.pdm.build]
3434
includes = [
3535
"pelican/",
36+
"static/",
37+
"templates/",
38+
"translations/",
3639
]
3740
excludes = [
3841
"**/.DS_Store",

pelican/themes/reflex/static/dark-theme/dark-theme.js renamed to static/dark-theme/dark-theme.js

File renamed without changes.

pelican/themes/reflex/static/dark-theme/dark-theme.min.js renamed to static/dark-theme/dark-theme.min.js

File renamed without changes.

pelican/themes/reflex/static/font-awesome/css/all.css renamed to static/font-awesome/css/all.css

File renamed without changes.

pelican/themes/reflex/static/font-awesome/css/all.min.css renamed to static/font-awesome/css/all.min.css

File renamed without changes.

0 commit comments

Comments
 (0)