Comments (9)
Good idea !
from sigal.
I'm thinking this should be in gallery.Gallery.build() ? Something like:
if self.settings['copy_htaccess']:
if exists('.htaccess'):
copy('.htaccess', self.settings['destination'])
from sigal.
I was thinking to something more generic, inspired by an old setting from pelican:
FILES_TO_COPY = (
('src/robots.txt', 'robots.txt'),
('src/images/favicon.ico','favicon.ico'),
)
A list of tuples with the src and dest for each file to copy.
from sigal.
Sounds good! :)
from sigal.
I'm not sure how to specify this. Is it possible to have it copy any .htaccess file found in the source directories? I want it simply to copy some files found in the source directory to the output directory...? I fear I'd have to specify every file.
files_to_copy = (('hires/2014/.htacess', 'gallyer/2014/.htaccess'),
('hires/2013/.htacess', 'gallyer/2013/.htaccess'),
('hires/2012/.htacess', 'gallyer/2012/.htaccess'),
('hires/2011/.htacess', 'gallyer/2011/.htaccess'),
('hires/2010/.htacess', 'gallyer/2010/.htaccess'),
)
from sigal.
I've simplified my access controls so I can now make due with the specification below. I still think a list of files that are copied from all source directories is preferable, but this will do. Thank you for the feature!
files_to_copy = (
('_extras/htaccess-lock-index', '1972-1995/.htaccess'),
('_extras/htaccess-lock-index', '1996-1999/.htaccess'),
('_extras/htaccess-lock-index', '1999/.htaccess'),
('_extras/htaccess-lock-index', '2000/.htaccess'),
('_extras/htaccess-lock-index', '2001/.htaccess'),
('_extras/htaccess-lock-index', '2002/.htaccess'),
('_extras/htaccess-lock-index', '2003/.htaccess'),
('_extras/htaccess-lock-index', '2004/.htaccess'),
('_extras/htaccess-lock-index', '2005/.htaccess'),
('_extras/htaccess-lock-index', '2006/.htaccess'),
('_extras/htaccess-lock-index', '2007/.htaccess'),
('_extras/htaccess-lock-index', '2008/.htaccess'),
('_extras/htaccess-lock-index', '2009/.htaccess'),
)
from sigal.
Hi Joseph,
Sorry for the lack of update, I was afk the last week-end. As the settings file is a python script you could use something like
files_to_copy = [('_extras/htaccess-lock-index', '{}/.htaccess'.format(dir)) for dir in os.listdir('_build')]
from sigal.
Huh, I'll think about that!
from sigal.
so once you'll have copied files in place, you'll notice that your gallery will prompt for passwords in sections even if they are not protected by .htaccess files. in case that's a problem for you, you may want to read up on the solution i found out in #220 (comment).
from sigal.
Related Issues (20)
- Encrypt plugin: Password field hidden behind pictures. HOT 2
- Using galleria theme causes empty whitespace in the base index page HOT 2
- Sigal not found HOT 2
- Problems with UTF8 characters on folders HOT 1
- 2.3: Issues with tests HOT 2
- Can't decrypt an encrypted gallery HOT 2
- tests fail with pillow release 10.0.0 HOT 8
- Some files have failed to be processed HOT 5
- KeyError: '.png'
- ImportError: cannot import name 'get_terminal_size' from 'click' HOT 3
- Album with hundreds of thumbnails crash Safari on iOS devices HOT 3
- 2.4: Themes are not installed, leading to failing tests HOT 5
- Fatal error: This version of Galleria requires classic theme version 1.6 or later HOT 1
- Changes to the log level only affect the 'sigal' logger HOT 3
- Document sort order options HOT 3
- left/right arrows even when using a touchscreen HOT 1
- mode for updating a single (sub-)album HOT 1
- boto should be removed from optional dependencies HOT 1
- Demos don't resolve (DNS issue) HOT 1
- KeyError after adding a directory to exclude patterns HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sigal.