Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/27/2020 in all areas

  1. З Різдвом Христовим!
    2 points
  2. Since others are getting into localsied greetings, Meri Kirihimete! (Although we're actually already a day ahead and Christmas was yesterday in my part of the world.)
    2 points
  3. 2 points
  4. Here's a little Hanna Code snippet I wrote that allows you to insert a tag that contains any HTML element of your choice along with any attributes. The only defined Hanna Code variables are "element" and "comment". If you leave element empty, it will automatically use the "div" HTML element. The "comment" variable is optional and doesn't get outputted on the frontend. It is only for internal use and if you want to actually describe what the Hanna Code is doing. Import these two into Hanna Code: "tag" !HannaCode:tag:eyJuYW1lIjoidGFnIiwidHlwZSI6IjIiLCJjb2RlIjoiXC8qaGNfYXR0clxuZWxlbWVudD1cImRpdlwiXG5jb21tZW50PVwiXCJcbmhjX2F0dHIqXC9cbjw/cGhwXG5cL1wvaWYoIGVtcHR5KCRhdHRyW1wiZWxlbWVudFwiXSkgKSByZXR1cm47XG4kcmV0dXJuID0gJzwnLiRhdHRyW1wiZWxlbWVudFwiXTtcbmZvcmVhY2goJGF0dHIgYXMgJGsgPT4gJGEpIHtcbiAgICBpZiggJGsgPT0gXCJlbGVtZW50XCIgfHwgJGsgPT0gXCJjb21tZW50XCIgKSBjb250aW51ZTtcbiAgICBpZiggIWVtcHR5KCRhKSApICRyZXR1cm4gLj0gJyAnLiRrLic9XCInLiRhLidcIic7XG59XG4kcmV0dXJuIC49ICc+JztcbmVjaG8gJHJldHVybjsifQ==/!HannaCode "end-tag" !HannaCode:end-tag:eyJuYW1lIjoiZW5kLXRhZyIsInR5cGUiOiIyIiwiY29kZSI6IlwvKmhjX2F0dHJcbmVsZW1lbnQ9XCJkaXZcIlxuaGNfYXR0cipcL1xuPD9waHBcblwvXC9pZiggZW1wdHkoJGF0dHJbXCJlbGVtZW50XCJdKSApIHJldHVybjtcbiRyZXR1cm4gPSAnPFwvJy4kYXR0cltcImVsZW1lbnRcIl0uJz4nO1xuZWNobyAkcmV0dXJuOyJ9/!HannaCode Now for some examples: Example 1: Section [[tag element="section"]] will output... <section> Example 2: Section with class [[tag element="section" class="myclass myotherclass"]] will output... <section class="myclass myotherclass"> Example 3: Section with id [[tag element="section" id="myid"]] will output... <section id="myid"> Example 4: Section with inline styles [[tag element="section" style="color:red"]] will output... <section style="color:red"> Example 5: Section with any attributes you want (data attributes for instance) [[tag element="section" my-custom-attribute="test-value" data-something="cool"]] will output... <section my-custom-attribute="test-value" data-something="cool"> Example 6: Same as above with "element" not defined (defaults to "div") [[tag my-custom-attribute="test-value" data-something="cool"]] will output... <div my-custom-attribute="test-value" data-something="cool"> Example 7: Same as above with "comment" set (which does not get outputted) [[tag my-custom-attribute="test-value" data-something="cool" comment="Don't remove this line or your page will get totally messed up!"]] will output... <div my-custom-attribute="test-value" data-something="cool"> Example 8: Close section tag [[end-tag element="section"]] will output... </section> Example 9: Close div tag [[end-tag]] will output... </div> Example with a common Bootstrap rows and columns scenario: [[tag class="row"]] [[tag class="col-sm-6"]] This is the first col. [[end-tag comment="end of first col"]] [[tag class="col-sm-6"]] This is the first col. [[end-tag comment="end of second col"]] [[end-tag comment="end of row"]] -- Note the following article regarding the terms "element" and "tag": http://perfectionkills.com/tag-is-not-an-element-or-is-it/
    1 point
  5. This week I’ve been doing some work on the core, but it’s been a short week with the holidays, so I’m holding off on committing the updates till I can test and tweak them a little more next week. I’ve been working on some upgrades to the core Fields editor (Setup > Fields), as well as some improvements to our Inputfields system, among other things. Next week I’m also planning on working through some of the GitHub issue reports and some other parts of the core as well. With it being Christmas today, I’ve barely been at the computer and I’m guessing not many of you are either, so I’ll keep this short and wish you and your family a Merry Christmas and/or Happy Holidays!
    1 point
  6. Sure thing! Here you go: var gulp = require("gulp"); var sass = require("gulp-sass"); var browserSync = require("browser-sync").create(); var autoprefixer = require("autoprefixer"); var rename = require("gulp-rename"); var cssnano = require("cssnano"); var postcss = require("gulp-postcss"); var minify = require("gulp-minify"); //var bourbon = require("bourbon").includePaths; //var neat = require("bourbon-neat").includePaths; // Put this after including our dependencies var paths = { styles: { // By using styles/**/*.sass we're telling gulp to check all folders for any sass file src: "./src/scss/*.scss", // Compiled files will end up in whichever folder it's found in (partials are not compiled) dest: "./dist/css/" },php: { src: './*.html', }, scripts: { src: "./src/js/*.js", dest: "./dist/js/" } // Easily add additional paths // ,html: { // src: '...', // dest: '...' // } }; function style() { return gulp .src(paths.styles.src) .pipe(sass({ outputStyle: "expanded" })) .pipe(gulp.dest(paths.styles.dest)) .pipe(rename({ suffix: ".min" })) .pipe(postcss([autoprefixer({ browsers: ['> 1%', 'last 3 versions', 'Firefox >= 20', 'iOS >=7'] }), cssnano()])) .pipe(gulp.dest(paths.styles.dest)) .pipe(browserSync.stream()) } exports.style = style; function php() { return gulp .src(paths.php.src) .pipe(browserSync.stream()) } exports.php = php; function script() { return gulp .src(paths.scripts.src) .pipe(minify({noSource: true})) .pipe(gulp.dest(paths.scripts.dest)) .pipe(rename({ suffix: ".min" })) } exports.script = script; function watch() { browserSync.init({ // You can tell browserSync to use this directory and serve it as a mini-server port: 8181, proxy: "http://localhost:8888/project-folder/" // If you are already serving your website locally using something like apache // You can use the proxy setting to proxy that instead // proxy: "yourlocal.dev" }); //I usually run the compile task when the watch task starts as well style(); script(); gulp.watch(paths.styles.src, style); gulp.watch(paths.scripts.src, script); gulp.watch(paths.php.src, php); } exports.watch = watch
    1 point
×
×
  • Create New...