From d6bc490fe60595d682cf3a3e9e85c839e41b28ae Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 8 Dec 2015 23:20:03 -0800 Subject: [PATCH] Fixed machine includes --- README.md | 11 +++++++++-- _config.yml | 2 ++ _includes/footer.html | 7 ++++--- _includes/head.html | 4 +--- _includes/machine-engines.html | 11 +++++++++-- _includes/machine-styles.html | 7 +++++++ 6 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 _includes/machine-styles.html diff --git a/README.md b/README.md index a45e47fe6..ae6961139 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,13 @@ layout: page title: PCjs permalink: / developer: false +machines: + - type: pc + id: ibm5150 + config: /devices/pc/machine/5150/mda/64kb/machine.xml + - type: c1p + id: demoC1P + config: /devices/c1p/machine/8kb/large/machine.xml --- Welcome to [PCjs](/docs/about/pcjs/), the first IBM PC simulation to run in your web browser without any plugins. @@ -16,7 +23,7 @@ All the simulations are written entirely in JavaScript. No Flash, Java or other Supported browsers include modern versions of Chrome, Safari, Firefox, Internet Explorer (v9.0 and up), Edge, and assorted mobile browsers. -[Embedded IBM PC](/devices/pc/machine/5150/mda/64kb/ "PCjs:ibm5150") +{% include machine.html id="ibm5150" %} The [simulation](/devices/pc/machine/5150/mda/64kb/) above features an Intel 8088 running at 4.77Mhz, with 64Kb of RAM and an IBM Monochrome Display Adapter. For more control, there are also @@ -52,7 +59,7 @@ Below is the [OSI Challenger C1P](/docs/c1pjs/), another simulation in the JavaS It simulates Ohio Scientific's 6502-based microcomputer, released in 1978. More details about this simulation and the original machine are available in the [C1Pjs Documentation](/docs/c1pjs/). -[Embedded OSI Challenger C1P](/devices/c1p/machine/8kb/large/ "C1Pjs:demoC1P") +{% include machine.html id="demoC1P" %} {% if page.developer %} diff --git a/_config.yml b/_config.yml index 507e8eca5..e186e4751 100644 --- a/_config.yml +++ b/_config.yml @@ -17,4 +17,6 @@ kramdown: input: GFM hard_wrap: false +# Custom site settings +pcjs_sitename: pcjs.net pcjs_version: 1.20.1 diff --git a/_includes/footer.html b/_includes/footer.html index be3976f7e..6ffd535e9 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -2,8 +2,6 @@
- - diff --git a/_includes/head.html b/_includes/head.html index bddf96e52..5bb5f46d7 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -18,7 +18,5 @@ - {% if page.machines %} - - {% endif %} + {% include machine-styles.html %} diff --git a/_includes/machine-engines.html b/_includes/machine-engines.html index c63e80849..17784b2f8 100644 --- a/_includes/machine-engines.html +++ b/_includes/machine-engines.html @@ -1,4 +1,11 @@ {% for machine in page.machines %} - - + {% capture machine_embed %}window.embed{{ machine.type | upcase }}{% endcapture %} + {% if machine.config %}{% capture machine_config %}{{ machine.config }}{% endcapture %}{% else %}{% assign machine_config = "machine.xml" %}{% endif %} + {% capture machine_template %}{{ site.baseurl }}/versions/{{ machine.type }}js/{{ site.pcjs_version }}/components.xsl{% endcapture %} + {% capture machine_script %}/{{ machine.type }}.js{% endcapture %} + {% unless machine_scripts contains machine_script %} + + {% endunless %} + {% capture machine_scripts %}{{ machine_scripts }}{{ machine_script }}{% endcapture %} + {% endfor %} diff --git a/_includes/machine-styles.html b/_includes/machine-styles.html new file mode 100644 index 000000000..57c6a3d04 --- /dev/null +++ b/_includes/machine-styles.html @@ -0,0 +1,7 @@ +{% for machine in page.machines %} + {% capture machine_style %}{{ site.baseurl }}/versions/{{ machine.type }}js/{{ site.pcjs_version }}/components.css{% endcapture %} + {% unless machine_styles contains machine_style %} + + {% endunless %} + {% capture machine_styles %}{{ machine_styles }}{{ machine_style }}{% endcapture %} +{% endfor %}