Giter Site home page Giter Site logo

Apache SSI Variable Issue about node-ssi HOT 15 CLOSED

kidwm avatar kidwm commented on September 25, 2024
Apache SSI Variable Issue

from node-ssi.

Comments (15)

67726e avatar 67726e commented on September 25, 2024

What does your actual markup look like? I need a reproducible sample. What you've given me is not even a valid SSI directive, so if that is what you have then it wouldn't even work to begin with.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

I am not able to add "" in comments.

Actually I have config.shtml file where I have few Apache variable defined and I am including this config.shtml file in index.shtml and getting values from variable like:

#set var="COMPONENTS" value="../components" in one config.shtml file.

and in separate index.shtml file I am including config.shtml file where I am reading path of "COMPONENTS" like.

#set var="PAGE_HEADER" value="${COMPONENTS}/c_page_header.shtml"

#include virtual="${TEMPLATES}/t_1.00_one_column.shtml"
and in template file I #include virtual="${PAGE_HEADER}"

All this is in DEV environment and It is running good in localhost. I am creating grunt build where I need to concatenate and all .shtml and create .html files with resolved "href" and "src" attributes.

Here is what I am getting error in command:
Warning: ENOENT, no such file or directory 'C:\wamp\www\practice\boilarplate\sta
ticTemplates\frontend_development\html\templates${PAGE_HEADER}' Use --force
to continue.

from node-ssi.

67726e avatar 67726e commented on September 25, 2024

You absolutely can include comments in GitHub. See:

<!--#set var="Foo" value="bar" -->

from node-ssi.

67726e avatar 67726e commented on September 25, 2024

Can you provide some example HTML? I don't need your production files, but I need a test case to work against.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

ok sure It will take little time but will provide you soon. Your help will be really appreciated.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

Hi Just committed templates with actual directory structure in https://github.com/mehulchauhan/boilerplate-shtml-sass/blob/master/staticTemplates/frontend_development/html/pages/home/index.shtml , can you please have a look.

you can take up staticTemplates folder and test with SSI it is not having anything apart for SSI.

from node-ssi.

67726e avatar 67726e commented on September 25, 2024

Ok. So you have three pages: config, index, and view1 and the problem is that the variable ${MODULES} from config is not being included in view1. That's just not how the setup works currently. It doesn't include variables from a sibling file into those of another sibling. I'll get this in once I get a chance.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

I will be really thankful to you if you can add this facility. Also after all this is done I m hoping ssi will concatenate and create .HTML file out of all this interlinked .shtml files with resolved href as well as SRC attributes path.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

I will be really thankful to you if you can add this facility. Also after all this is done I m hoping ssi will concatenate and create .HTML file out of all this interlinked .shtml files with resolved href as well as SRC attributes path.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

I will be really thankful to you if you can add this facility. Also after all this is done I m hoping ssi will concatenate and create .HTML file out of all this interlinked .shtml files with resolved href as well as SRC attributes path.

from node-ssi.

67726e avatar 67726e commented on September 25, 2024

@mehulchauhan @thomaswelton I've published the updated NPM module, version 1.5, with this update. Let me know how things go.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

I just tested ssi 1.5 with my folder structure and getting error "Warning: ENOENT, no such file or directory 'C:\wamp\www\GitHub\boilerplate-shtml-sass\staticTemplates\frontend_development\html\templates${DOCUMENT_HEADER}' Us
e --force to continue."

can you please check "https://github.com/mehulchauhan/boilerplate-shtml-sass" structure. I have written Gruntfile.js to run ssi. here I am passing /pages folder for ssi to process. can you please help me to resolve issue.

from node-ssi.

67726e avatar 67726e commented on September 25, 2024

That was a fun little issue to hunt down:

<!--#include virtual="../../../config.shtml" -->
<!--#set var="DOCUMENT_HEADER" value="${COMPONENTS}/c_document_header.shtml"-->

Can you spot the difference between these two directives? If you guess that there is a space at the end of the first but not the second, you guessed right! As luck would have it, some of the documentation I consulted was somewhat inaccurate, incomplete, or otherwise made entirely incorrect statements about what is a requirement for an SSI directive. In this case I distinctly remember it stating that a space before the end of the directive was required.

What it amounts to is I need to revisit some of the requirements for what constitutes a valid directive and loosen them. There is a Pull Request to do this. I'll have a little more work to do, but it should arrive in the near future. In the mean time, if you want to get your code to build, you can do a find/replace on --> and change it to --> so the space exists and the parser picks it up.

from node-ssi.

mehulchauhan avatar mehulchauhan commented on September 25, 2024

Thanks for this solution now ssi is concatenating all.shtml files, but can you please tell me how I should update extension of output file(i.e ssi is creating .shtml as output file and I want output file extension to be .html), It will be great help.

from node-ssi.

67726e avatar 67726e commented on September 25, 2024

That's really beyond the scope of this project. Your best bet is to output the files into another directory and do a rename on them.

from node-ssi.

Related Issues (19)

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.