Giter VIP home page Giter VIP logo

ssi-server's Introduction

ssi-server

Server Side Includes in Python's SimpleHTTPServer

Use this in the same way as Python's SimpleHTTPServer:

./ssi_server.py [port]

The only difference is that, for files ending in '.html', ssi_server will inline SSI (Server Side Includes) of the form:

<!-- #include virtual="fragment.html" -->

Quick start:

git clone https://github.com/danvk/ssi-server.git
cd ssi-server
./ssi_server
(visit localhost:8000) in your browser.

ssi-server's People

Contributors

barentsen avatar danvk avatar koirikivi avatar thedavecollins avatar xdrus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssi-server's Issues

Changing the web root

If I wanted to run this script from say a level above is it possible

i..e

ssi_script
www

So I would like to run the content of www as the document root if that makes sense?

ssi_expander.py: "NameError: name 'file' is not defined" with python3

Error:

user@workstation user % python3 ../ssi-server/ssi_expander.py site site_expanded
Traceback (most recent call last):
  File "/Users/user/work/site/../ssi-server/ssi_expander.py", line 45, in <module>
    process(source, dest)
  File "/Users/user/work/site/../ssi-server/ssi_expander.py", line 27, in process
    file(dest_path, 'w').write(ssi.InlineIncludes(src_path, "/%s" % os.path.relpath(src_path)))

Here's what I found on the internet:

The file function was removed in Python 3. In Python 3, you should use the open function instead.

open(dest_path, 'w').write(ssi.InlineIncludes(src_path, "/%s" % os.path.relpath(src_path)))

This resolves the error.

Add "python"?

Running ./ssi_server as mentioned in the doc did not work on my Mac, I did some Googling and found that I have to use something like python ssi_server.py. Probably a Python configuration issue on my Mac, but I don't know anything about Python, and I thought I'd let you know. More noobs might run into this.

Thanks for creating ssi-server, saves me lots of copy-pasting when building HTML prototypes!

It's probably not an issue with this, more likely an issue with me but ...

I followed the quick start guide, but last step did not work for me:

Last login: Thu Aug 4 21:30:12 on ttys000
me@mycomputer ~ % git clone https://github.com/danvk/ssi-server.git
Cloning into 'ssi-server'...
remote: Enumerating objects: 48, done.
remote: Total 48 (delta 0), reused 0 (delta 0), pack-reused 48
Receiving objects: 100% (48/48), 11.58 KiB | 127.00 KiB/s, done.
Resolving deltas: 100% (21/21), done.
me@mycomputer ~ % cd ssi-server
me@mycomputer ssi-server % ./ssi_server
zsh: no such file or directory: ./ssi_server

I was running this on an M1 MacBook Air, and have installed Python 3. I can run the server, but cannot get it to process include files.

I tweeted here: https://twitter.com/lloydi/status/1555296947677847552?s=20&t=JL-uI1AihhLf--Rp4IobaQ

People referred me to this.

If you are able to help, I'd appreciate it. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.